import "package:ct_pa_majordomo/config/theme_vars.dart";
import "package:flutter/cupertino.dart";

class InfoItem extends StatelessWidget {
  final String label;
  final String value;
  final Widget? suffix;
  const InfoItem({super.key, required this.label, required this.value, this.suffix});

  @override
  Widget build(BuildContext context) {
    return DefaultTextStyle(
      style: const TextStyle(fontSize: 15, color: ThemeVars.colorText),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          Row(
            children: [
              SizedBox(
                width: 80,
                child: Text("$label：", textAlign: TextAlign.right, style: const TextStyle(color: ThemeVars.colorTextTer),),
              ),
              Text(value),
            ],
          ),
          if (suffix != null) suffix!
        ],
      ),
    );
  }

}